<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  props: {
    modelValue: { type: Boolean, required: true },
    text: String,
  },
});
</script>

<template>
  <view class="travel-item">
    <view
      class="travel-item-wrapper"
      :class="{ 'travel-item-active': modelValue }"
    >
      <view class="travel-item-text">{{ text }}</view>
    </view>
    <image
      class="travel-item-icon"
      v-if="modelValue"
      src="@/package/mall/static/jps-package-check.png"
    />
  </view>
</template>

<style lang="scss">
.travel-item {
  position: relative;

  .travel-item-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80rpx;
    padding: 0 10rpx;
    border-radius: 10rpx;
    border: 2rpx solid #fafafa;
    background-color: #fafafa;
  }

  .travel-item-text {
    font-size: 28rpx;
    color: #2d2d2d;
    line-height: 40rpx;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    text-overflow: ellipsis;
    overflow: hidden;
  }

  .travel-item-active {
    border-color: #ff7900;
    background-color: rgba(255, 121, 0, 0.05);
  }

  .travel-item-icon {
    position: absolute;
    left: 0;
    top: -10rpx;
    width: 40rpx;
    height: 24rpx;
  }
}
</style>
